const Controller = require('egg').Controller;
class Order extends Controller {
    //创建
    async createOrder() {
        const { ctx, service } = this;
        const order = await service.order.createOrder(ctx.request.body)
        ctx.body = order
    }
    // 获取order
    async getOrders() {
        const { ctx, service } = this;
        const result = await service.order.getOrders()
        ctx.body = result;
    }
    //获取详情
    async getOrderById() {
        const { ctx, service } = this;
        const order = await service.order.getOrderById()
        ctx.body = order
    }
    //获取当前用户
    async getMyOrder() {
        const { ctx, service } = this;
        const orders = await service.order.getMyOrders()
        ctx.body = orders
    }
}

module.exports = Order;